package org.example.service;

import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.UnsupportedEncodingException;
import java.util.List;

public interface IRapidOcrService {

    /**
     * 将pdf转换为图片
     * @param file
     * @return List<String>
     */
    public List<String> pdfToImage(MultipartFile file);

    /**
     * 执行OCR识别
     * @param imgPaths
     * @return
     */
    public String doOcr(List<String> imgPaths);

    /**
     * 执行单张图片识别
     * @param fileUpload
     * @return
     */
    public String doImageOcr(MultipartFile fileUpload);

    /**
     * 将pdf转换为word
     * @param file
     * @param response
     * @throws UnsupportedEncodingException
     */
    public void pdfToWord(MultipartFile file, HttpServletResponse response) throws UnsupportedEncodingException;

    /**
     * 将Word文档转换为PDF文件
     *
     * @param file  输入Word文件路径
     * @param response 响应对象
     * @return 转换是否成功
     */
    public boolean convertWordToPdf(MultipartFile file, HttpServletResponse response);

}
